package fybug.nulll.pdstream.Source.Interface;
import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;

import fybug.nulll.pdfunctionlibrary.Annotations.MaybeStop;
import fybug.nulll.pdfunctionlibrary.Processing.Err.CallStop;
import fybug.nulll.pdfunctionlibrary.Processing.Err.Stop;
import fybug.nulll.pdstream.Source.StreamSource;
/**
 * <h2>数据检查接口.</h2>
 * <pre>
 * 用于在 {@link StreamSource} 绑定数据和获取数据时进行校验
 * </pre>
 *
 * @param <E> 校验的数据类型
 *
 * @author fybug
 * @version 0.0.1
 * @see MaybeStop
 * @see Stop
 * @see CallStop
 * @see StreamSource
 * @since JDK 1.8
 */
@SuppressWarnings( "all" )
public
interface CheckData<E> {
    /**
     * <p>检查传入的数据类型.</p>
     * <pre>
     * 输出可为{@code null}
     * </pre>
     */
    @Nullable
    E put(E data);

    /** <p>检查传出的数据.</p> */
    @NotNull
    @MaybeStop
    E get(Object data);
}
